/* ******************************************** */
/* * Robot Utilities Library                  * */
/* * Authors: André Bannwart Perina           * */
/* *          Antonio Canabrava Fraideinberze * */
/* *          Willian Felipe Lopes da Silva   * */
/* ******************************************** */

#ifndef RUTILS_H
#define RUTILS_H

#include <libplayerc/playerc.h>

/* ** Move Robot to Relative Position - Non-blocking ************************************************ */
/* * Description: Commands the robot to move to a relative position, without blocking execution     * */
/* * Inputs: client - Player / Stage Client                                                         * */
/* *         device - Position Device                                                               * */
/* *         px - Units to move on x axis                                                           * */
/* *         py - Units to move on y axis                                                           * */
/* *         pa - Units to move angularly                                                           * */
/* *         vx - x Axis Speed                                                                      * */
/* *         vy - y Axis Speed                                                                      * */
/* *         va - Angular Speed                                                                     * */
/* * Output: Return value from playerc_position2d_set_cmd_pose_with_vel                             * */
/* ************************************************************************************************** */
inline int rutils_move_rel_nblk(playerc_client_t *, playerc_position2d_t *, double, double, double, double, double, double);

/* ** Move Robot to Relative Position - Blocking **************************************************** */
/* * Description: Commands the robot to move to a relative position, blocking execution until a     * */
/* *              tolerable position is reached                                                     * */
/* * Inputs: client - Player / Stage Client                                                         * */
/* *         device - Position Device                                                               * */
/* *         px - Units to move on x axis                                                           * */
/* *         py - Units to move on y axis                                                           * */
/* *         pa - Units to move angularly                                                           * */
/* *         vx - x Axis Speed                                                                      * */
/* *         vy - y Axis Speed                                                                      * */
/* *         va - Angular Speed                                                                     * */
/* *         pxTol - Tolerable distance on x axis to unblock execution                              * */
/* *         pyTol - Tolerable distance on y axis to unblock execution                              * */
/* *         paTol - Tolerable angular distance to unblock execution                                * */
/* * Output: Return value from playerc_position2d_set_cmd_pose_with_vel                             * */
/* ************************************************************************************************** */
int rutils_move_rel_blk(playerc_client_t *, playerc_position2d_t *, double, double, double, double, double, double, double, double, double);

/* ** Rotate Robot to Relative Heading - Non-blocking *********************************************** */
/* * Description: Commands the robot to rotate to a relative heading, without blocking execution    * */
/* * Inputs: client - Player / Stage Client                                                         * */
/* *         device - Position Device                                                               * */
/* *         pa - Units to move angularly                                                           * */
/* *         va - Angular Speed                                                                     * */
/* * Output: Return value from playerc_position2d_set_cmd_pose_with_vel                             * */
/* ************************************************************************************************** */
inline int rutils_rotate_rel_nblk(playerc_client_t *, playerc_position2d_t *, double, double);

/* ** Rotate Robot to Relative Heading - Blocking *************************************************** */
/* * Description: Commands the robot to rotate to a relative heading, blocking execution until a    * */
/* *              tolerable heading is reached                                                      * */
/* * Inputs: client - Player / Stage Client                                                         * */
/* *         device - Position Device                                                               * */
/* *         pa - Units to move angularly                                                           * */
/* *         va - Angular Speed                                                                     * */
/* *         paTol - Tolerable angular distance to unblock execution                                * */
/* * Output: Return value from playerc_position2d_set_cmd_pose_with_vel                             * */
/* ************************************************************************************************** */
int rutils_rotate_rel_blk(playerc_client_t *, playerc_position2d_t *, double, double, double);

#endif